<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html >
<html>
<head>
<title><spring:message code="message.lable.DICdiQuWeiHuJiLu"/></title>
<%@ include file="/WEB-INF/component/commonCSS.jsp" %>
<!--[if lt IE 9]>
    <script src="lib/js/html5shiv.min.js"></script>
    <script src="lib/js/respond.min.js"></script>
<![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
    <h1><spring:message code="message.lable.DICdiQuWeiHuJiLu"/></h1>
    <ol class="breadcrumb">
        <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.DicManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.areaDic"/></a></li>
    </ol>
    </section>
    <section class="content">
    <div class="box box-success">
        <div class="box-body">
            <div class="form-inline">
                <div class="form-group form-group-xs">
		          <spring:message code="message.listForm.xiuGaiRiQi"/>：
		           <input class="form-control" type="text" id="startDate"  name="startDate" placeholder="yyyy-MM-dd"
		                onFocus="var endDate=$dp.$('endDate');WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')}'})"
		              />
		            -
		           <input class="form-control" type="text" id="endDate"  name="endDate" placeholder="yyyy-MM-dd"
		             onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}'})"
		              />
		        </div>

                <button type="button" onclick="gridSerch()" class="btn btn-success btn-sm"><spring:message code="message.button.seach"/>
                </button>
            </div>
        </div>
    </div>
    <table class="jqgrid" id="gridlist"></table>
    <div id="gridpage"></div>
    <div class=" box box-warning bottongroup">
        <a href="${ctx}/dicArea/toList.html" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
    </div>
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script type="text/javascript">
        $(function() {
            $("#gridlist")
                .jqGrid({
                    url : "${pageContext.request.contextPath}/dicAreaLog/getLogDataList.html?areaid=${areaid}",
                    mtype : "POST",
                    datatype : "json",
                    autowidth : true,
                    //shrinkToFit: false,
                    height : 270,
                    colNames : ['',
                                '<spring:message code="message.jqGrid.cz"/>',
                                '<spring:message code="message.listForm.xiuGaiXiangQing"/>',
                                '<spring:message code="message.listForm.xiuGaiRen"/>',
                                '<spring:message code="message.listForm.xiuGaiShiJian"/>'
                                ],
                    colModel : [  { name : 'log_id', width : 200, align : "left", hidden:true },
								 { name: 'operate', index: 'operate',width:10,key:true, align: "center",
								    formatter : function(val, opts, rowdata) {
								     return "<a href='${ctx}/dicAreaLog/toAreaLogDetail.html?logId="+rowdata.log_id+ "'  style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a>";
								     }
								 },
                                 { name : 'detail', width : 200, align : "left" },
                                 { name : 'updUser', width : 30, align : "left" },
                                 { name : 'literUpdDttm', width : 35, align : "left" }
                               ],
                    rowNum : 20,
                    rowList : [ 10, 20, 50,100 ],
                    rownumbers : true,
                    pager : "#gridpage",
                    viewrecords : true,
                    caption : "${areaid} - ${areaName}&nbsp;<spring:message code="message.jqGrid.cz.weiHuJiLuLieBiao"/>",
                    //序号宽度自动变化
                    gridComplete:function(){
                        //序号列宽度自适应（参数为jqgridID）
                        autoRNWidth("gridlist");
                        //数据只有一条时默认选中（参数为jqgridID）
                        selectByOneData("gridlist");
                    },
                    jsonReader : {
                        repeatitems : false,
                        id : "ids"
                    }
                });
            $("#gridlist").jqGrid('navGrid', '#gridpage', {
                add : false,
                edit : false,
                del : false,
                search : false,
                refresh : false
            });
            $(window).trigger("resize");
        });

        function gridSerch() {
            var startDate = $("#startDate").val();
            if (startDate.length > 0) {
                startDate += " 00:00:00";
            }
            var endDate = $("#endDate").val();
            if (endDate.length > 0) {
                endDate += " 23:59:59"
            }
            $("#gridlist")
                .jqGrid('setGridParam',{
                    url : "${pageContext.request.contextPath}/dicAreaLog/getLogDataList.html?areaid=${areaid}&startDate="+ startDate + "&endDate=" + endDate,page : 1
                        }).trigger("reloadGrid");
        }
    </script>
</body>
</html>
